//auto gen by paipai.java.augogen ver 1.0
//auther wendyhu
#ifndef _COOPERATORDAO_COOPERATOR_H_
#define _COOPERATORDAO_COOPERATOR_H_

#include <stdint.h>
#include <string>
#include <iostream>
#include "app_platform/help_macros.h"
#include "app_platform/intf_service.h"
#include "intf_cooperatordao.h"



#include "app_comm/uin_limit.h"
#include "library/basic/singleton_t.h"
#include "library/basic/sync_lock.h"
#include "c2cent/library/log/CWTimeElf3.h"

#include "cooperator_db_operator.h"

#include <set>
#include <vector>
#include "b2b2c/cooperator/ddo/cooperatorbaseinfoddo_cooperator.h"
#include "b2b2c/cooperator/ddo/cooperatorlicenseddo_cooperator.h"
#include "b2b2c/cooperator/ddo/cooperatormonitormodelddo_cooperator.h"
#include "b2b2c/cooperator/ddo/cooperatorsetddo_cooperator.h"
#include "b2b2c/cooperator/ddo/cooperatorproddo_cooperator.h"
namespace b2b2c
{
namespace cooperator
{
namespace dao
{


SERVICE class CCooperatorDao : public ICooperatorDao{
public:
		CCooperatorDao(enum DeployMethod method = DEPLOY_STANDALONE);
		~CCooperatorDao();

		void Reset();
		static int Initialize(IUserDefineCntl* pCntl = NULL);

public:
		 /**
		 *
		 *   检查合作伙伴密码信息
		 *
		 */
		EXPORT(0xA0111803) uint32_t CheckCooperatorPassWd(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 uint64_t ddwCooperatorId,
			 const std::string& strCooperatorPassword,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   删除告警模版
		 *
		 */
		EXPORT(0xA0101807) uint32_t DeleteCooperatorMonitorModel(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 uint32_t dwCooperatorId,
			 uint32_t dwModelId,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   获取合作伙伴基本信息
		 *
		 */
		EXPORT(0xA0111801) uint32_t GetCooperatorBaseInfo(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 uint64_t ddwCooperatorId,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 b2b2c::cooperator::ddo::CCooperatorBaseInfoDdo& oCooperatorBaseInfoDdo,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   获取合作伙伴数据加密Key
		 *
		 */
		EXPORT(0xA0111804) uint32_t GetCooperatorKey(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 uint64_t ddwCooperatorId,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::string& strSCooperatorKey,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   获取合作伙伴许可证信息
		 *
		 */
		EXPORT(0xA0111802) uint32_t GetCooperatorLicense(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 uint64_t ddwCooperatorId,
			 const std::set<uint8_t> & setLicenseType,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::vector<b2b2c::cooperator::ddo::CCooperatorLicenseDdo> & vecCooperatorLicenseDdo,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   通过模版ID获取告警模版
		 *
		 */
		EXPORT(0xA0111806) uint32_t GetCooperatorMonitorModel(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 uint32_t dwCooperatorId,
			 uint32_t dwModelId,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 b2b2c::cooperator::ddo::CCooperatorMonitorModelDdo& oCooperatorMonitorModelDdo,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   获取价格告警模版列表
		 *
		 */
		EXPORT(0xA0111805) uint32_t GetCooperatorMonitorModelList(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 uint32_t dwCooperatorId,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::vector<b2b2c::cooperator::ddo::CCooperatorMonitorModelDdo> & vecCooperatorMonitorModelDdo,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   从管理后台等其他业务同步过来的设置合作伙伴属性位等信息的接口
		 *
		 */
		EXPORT(0xA0101805) uint32_t SetCooperatorInfo(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 uint64_t ddwOption,
			 const b2b2c::cooperator::ddo::CCooperatorSetDdo& oCooperatorSetDdo,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   设置合作伙伴密码信息
		 *
		 */
		EXPORT(0xA0101802) uint32_t SetCooperatorPassWd(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 uint64_t ddwCooperatorId,
			 const std::string& strCooperatorOldPassword,
			 const std::string& strCooperatorNewPassword,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   支付物流系统设置卖家的次日达，货到付款等属性位接口
		 *
		 */
		EXPORT(0xA0101804) uint32_t SetCooperatorPro(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 uint64_t ddwOption,
			 const b2b2c::cooperator::ddo::CCooperatorProDdo& oCooperatorProDdo,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   更新【新增和修改】合作伙伴基本信息
		 *
		 */
		EXPORT(0xA0101801) uint32_t UpdateCooperatorBaseInfo(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 const b2b2c::cooperator::ddo::CCooperatorBaseInfoDdo& oCooperatorBaseInfoDdo,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   更新【新增和修改】合作伙伴许可证信息
		 *
		 */
		EXPORT(0xA0101803) uint32_t UpdateCooperatorLicense(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 const b2b2c::cooperator::ddo::CCooperatorLicenseDdo& oCooperatorLicenseDdo,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::string& strOutReserve
			);

		 /**
		 *
		 *   新增或者更新告警模版
		 *
		 */
		EXPORT(0xA0101806) uint32_t UpdateCooperatorMonitorModel(
			 const CCntlInfo& rCntlInfo,
			 const std::string& strMachineKey,
			 const std::string& strSource,
			 uint32_t dwSceneId,
			 const b2b2c::cooperator::ddo::CCooperatorMonitorModelDdo& oCooperatorMonitorModelDdo,
			 const std::string& strInReserve,
			 std::string& strErrmsg,
			 std::string& strOutReserve
			);

private:
    /**
     *
     * 初始化TMEM
     *@return  uint32_t : 0(成功) 其它失败
     *
     */
    static int32_t InitTMEM(IUserDefineCntl* pCntl = NULL);

    static c2cent::library::wtimeelf::CItilGroup m_oUpdateCooperatorBaseInfoGroup;
    static c2cent::library::wtimeelf::CItilGroup m_oGetCooperatorLicenseGroup;
    static c2cent::library::wtimeelf::CItilGroup m_oGetCooperatorBaseInfoGroup;
    static c2cent::library::wtimeelf::CItilGroup m_oSetCooperatorPassWdGroup;
    static c2cent::library::wtimeelf::CItilGroup m_oCheckCooperatorPassWdGroup;
    static c2cent::library::wtimeelf::CItilGroup m_oUpdateCooperatorLicenseGroup;
    static c2cent::library::wtimeelf::CItilGroup m_oGetCooperatorKeyGroup;
    static c2cent::library::wtimeelf::CItilGroup m_oLogisticsSetCooperatorPro;
    static c2cent::library::wtimeelf::CItilGroup m_oSetCooperatorInfo;

    static c2cent::library::wtimeelf::CItilGroup m_oGetMonitorModelListGroup;
    static c2cent::library::wtimeelf::CItilGroup m_oGetMonitorModelGroup;
    static c2cent::library::wtimeelf::CItilGroup m_oUpdateMonitorModelGroup;
    static c2cent::library::wtimeelf::CItilGroup m_oDeleteMonitorModelGroup;

private:

	enum DeployMethod m_method;
    static item::cooperator::db::CCooperatorDBOperator m_oDBOperator;
    uint32_t m_dwOperatorUin;
    uint32_t m_dwSceneId;
    std::string m_strMachineKey;
    std::string m_strSource;
};

}
}
}

#endif /* _COOPERATORDAO_COOPERATOR_H_ */
